home *** CD-ROM | disk | FTP | other *** search
/ Programming Microsoft Visual Basic .NET / Programming Microsoft Visual Basic .NET (Microsoft Press)(X08-78517)(2002).bin / setup / vbnet / 23 web forms and controls / databinding / repeaterform.aspx < prev    next >
Encoding:
ASP.NET Web Form  |  2002-03-17  |  2.6 KB  |  73 lines

  1. <%@ Page Language="vb" AutoEventWireup="false" Codebehind="RepeaterForm.aspx.vb" Inherits="DataBinding.RepeaterForm" %>
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  3. <HTML>
  4.     <HEAD>
  5.         <title>RepeaterForm</title>
  6.         <meta content="Microsoft Visual Studio.NET 7.0" name="GENERATOR">
  7.         <meta content="Visual Basic 7.0" name="CODE_LANGUAGE">
  8.         <meta content="JavaScript" name="vs_defaultClientScript">
  9.         <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
  10.     </HEAD>
  11.     <body>
  12.         <form id="Form1" method="post" runat="server">
  13.             <H1><SPAN style="FONT-SIZE: large; FONT-FAMILY: 'Arial Black'"><FONT face="Times New Roman">Repeater 
  14.                         Control Demo</FONT></SPAN></H1>
  15.             <P><SPAN style="FONT-SIZE: large; FONT-FAMILY: 'Arial Black'"><FONT face="Times New Roman" size="3">This 
  16.                         page demonstrates several features of the Repeater control, including the 
  17.                         ability to contain a button and react to clicks on it, and the degree of 
  18.                         customization you can achieve by trapping the ItemCreated and ItemDataBound 
  19.                         events.</FONT></SPAN></P>
  20.             <P> </P>
  21.             <P>
  22.                 <asp:repeater id="Repeater1" runat="server">
  23.                     <HeaderTemplate>
  24.                         <b>Bulleted list of publishers: </b>
  25.                         <br />
  26.                         <hr />
  27.                     </HeaderTemplate>
  28.                     <ItemTemplate>
  29.                         <li>
  30.                             <%# Container.DataItem("Name") %>
  31.                         </li>
  32.                     </ItemTemplate>
  33.                     <AlternatingItemTemplate>
  34.                         <span style="BACKGROUND-COLOR: #ffff99">
  35.                             <li>
  36.                                 <%# DataBinder.Eval(Container, "DataItem(""Name"")") %>
  37.                             </li>
  38.                         </span>
  39.                     </AlternatingItemTemplate>
  40.                     <SeparatorTemplate>
  41.                         <br />
  42.                     </SeparatorTemplate>
  43.                     <FooterTemplate>
  44.                         <hr />
  45.                     </FooterTemplate>
  46.                 </asp:repeater></P>
  47.             <P>
  48.                 <asp:repeater id="Repeater2" runat="server">
  49.                     <HeaderTemplate>
  50.                         <b>List of publishers with a More Info button: </b>
  51.                         <br />
  52.                         <hr />
  53.                     </HeaderTemplate>
  54.                     <ItemTemplate>
  55.                         <asp:Button runat=server Text='more info' CommandName='moreinfo' CommandArgument='<%# Container.DataItem("PubId") %>' ID="Button1"/>
  56.                         <%# Container.DataItem("Name") %>
  57.                         (
  58.                         <asp:HyperLink Runat=server NavigateUrl='ShowTitles.aspx?pubid=<%# Container.DataItem("PubId") %>'>Show Titles</asp:HyperLink>)
  59.                     </ItemTemplate>
  60.                     <SeparatorTemplate>
  61.                         <br />
  62.                     </SeparatorTemplate>
  63.                     <FooterTemplate>
  64.                         <hr />
  65.                     </FooterTemplate>
  66.                 </asp:repeater></P>
  67.             <P>
  68.                 <asp:Label id="Label1" runat="server">Label</asp:Label>
  69.         </form>
  70.         </P>
  71.     </body>
  72. </HTML>
  73.